package com.mall.user.domain.model;

public record Age(int age) {
    public Age {
        if(age<18 || age>35){
            throw new IllegalArgumentException("用户年龄不符合要求");
        }
    }

    public static Age of(int age){
        return new Age(age);
    }
}
